<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::post('index/base', 'Index/base');
Route::post('upload/upload-image', 'Upload/uploadImage');
Route::post('upload/upload-file', 'Upload/uploadFile');
Route::get('upload/info', 'Upload/info');
Route::post('user/login', 'User/login');
Route::get('user/index', 'User/index');
Route::post('user/save', 'User/save');
Route::get('user/info', 'User/info');
Route::get('user/read/:id', 'User/read');
Route::put('user/update/:id', 'User/update');
Route::put('user/initUserPassword', 'User/initUserPassword');
Route::post('user/modifyPassword', 'User/modifyPassword');
Route::post('user/modifyPassword', 'User/modifyPassword');
Route::post('user/updateInfo', 'User/updateInfo');
Route::delete('user/delete', 'User/delete');
Route::put('user/bindStock', 'User/bindStock');


Route::resource('user', 'User');
Route::get('user/info', 'User/info');
Route::post('user/logout', 'User/logout');

Route::get('menu/index', 'Menu/index');
Route::get('menu/tree', 'Menu/tree');
Route::post('menu/save', 'Menu/save');
Route::put('menu/update/:id', 'Menu/update');

Route::get('dataDict/list', 'DataDict/list');

Route::resource('wechat-user', 'WechatUser');

Route::get('setting/statistics', 'Setting/statistics');
Route::get('setting/clearAllCache', 'Setting/clearAllCache');
Route::resource('setting', 'Setting');

Route::get('role/index', 'role/index');
Route::get('role/list', 'role/list');
Route::get('role/getMenuByRole/:id', 'role/getMenuByRole');
Route::post('role/save', 'role/save');
Route::put('role/update/:id', 'role/update');
Route::put('role/numberOperation', 'role/numberOperation');
Route::put('role/changeStatus', 'role/changeStatus');
Route::put('role/menuPermission/:id', 'role/menuPermission');
Route::delete('role/delete', 'role/delete');

Route::get('logs/getOperLogPageList', 'Logs/getOperLogPageList');

Route::get('device/types', 'Device/types');
Route::get('device/index', 'Device/index');
Route::post('device/save', 'Device/save');
Route::put('device/update/:id', 'Device/update');
Route::get('device/read/:id', 'Device/read');
Route::delete('device/delete', 'Device/delete');
Route::post('device/batchUpdateStatus', 'Device/batchUpdateStatus');

Route::get('stock/read/:id', 'Stock/read');
Route::get('stock/index', 'Stock/index');
Route::post('stock/save', 'Stock/save');
Route::put('stock/update/:id', 'Stock/update');
Route::delete('stock/delete', 'Stock/delete');
Route::put('stock/userAssign/:id', 'Stock/userAssign');

Route::get('stockSetting/read/:id', 'StockSetting/read');
Route::post('stockSetting/save', 'StockSetting/save');
Route::post('stockSetting/copy', 'StockSetting/copy');

Route::get('stockSettingTpl/read/:id', 'stockSettingTpl/read');
Route::get('stockSettingTpl/index', 'stockSettingTpl/index');
Route::post('stockSettingTpl/save', 'stockSettingTpl/save');
Route::put('stockSettingTpl/update/:id', 'stockSettingTpl/update');
Route::delete('stockSettingTpl/delete', 'stockSettingTpl/delete');

Route::get('report/dashboard', 'report/dashboard');
Route::get('report/grainSituation', 'report/grainSituation');
Route::get('report/grainSituationHistory', 'report/grainSituationHistory');
Route::get('report/statistics', 'report/statistics');

Route::miss(function () {
    return json([
        'code' => 1,
        'message' => 'system url not found2',
        'data' => [],
    ]);
});